﻿#pragma once

#include "Pass.h"

class ComposePass : public  Pass
{
public:
    ComposePass();
    ~ComposePass() = default;
public:
    virtual void BuildRenderItems(std::vector<std::unique_ptr<RenderItem>>& allRitems,UINT& lastObjIndex) override;

    virtual void BuildPSOs(
         ID3D12Device* device,
         DXGI_FORMAT BackBufferFormat,
         DXGI_FORMAT DepthStencilFormat,
         bool _4xMsaaState,
         UINT _4xMsaaQuality
     ) override;
    
    virtual void Draw(
        ID3D12GraphicsCommandList* cmdList,
        CD3DX12_GPU_DESCRIPTOR_HANDLE hGpuHandler,
        UINT srvHeapSize,
        UINT objCBByteSize,
        UINT matCBByteSize,
        UINT passCBByteSize,
        ID3D12Resource* objectCB,
        ID3D12Resource* matCB,
        ID3D12Resource* passCB,
        const PassConstants& passValue,
        ID3D12Resource* OutColorRenderTarget,
        D3D12_CPU_DESCRIPTOR_HANDLE OutColorRenderTargetView,
        D3D12_CPU_DESCRIPTOR_HANDLE OutDepthStentilView
        ) override;

public:
    void SetBaseAndEdgeMap(CD3DX12_GPU_DESCRIPTOR_HANDLE baseRTView,CD3DX12_GPU_DESCRIPTOR_HANDLE edgeRTView);
private:
    void DrawFullscreenQuad(ID3D12GraphicsCommandList* cmdList);
private:
    CD3DX12_GPU_DESCRIPTOR_HANDLE mBaseRTView;
    CD3DX12_GPU_DESCRIPTOR_HANDLE mEdgeRTview;
    
};
